/**
 * add baby's info
 */

function firstBabyAdd(){
	$('div.firstBabyBook').on('click', function(){
		$('.addYourBaby').fadeIn('slow');
	});

	$('#cancle').on('click', function(){
		$('.addYourBaby').fadeOut('slow');
	});
}

function saveform() {
	alert(111111111111111111111111111111);
	
	var name = $('#name').val();
	var borndate = $('#borndate').val();			/* 태어난 날짜 */
	var bornweek = $('#bornweek').val();	/* 어머니뱃속에 있던 기간 */
	var sex = $('.genderRadio:checked').val();
	
	var headsize = $('#headSize').val();
	var height = $('#height').val();
	var weight = $('#weight').val();
	
	var deliveryinfo = $('.deliveryInfo:checked').val();	/* 자연분만, 제왕절개 */
	var birthtype = $('.birthType:checked').val();			/* 만삭, 조산 */
	var birthlocation = $('#birthlocation').val();
	/* -- test alert -- */
	alert(name);
	alert(borndate);
	alert(bornweek);
	alert(sex);
	
	alert(headsize);
	alert(height);
	alert(weight);
	
	alert(deliveryinfo);
	alert(birthtype);
	alert(birthlocation);
	
	$.ajax({
		url: '../sanghyo/baby.action',
		type: 'POST',
		dataType: 'json',
		data: {name:name, borndate:borndate, bornweek:bornweek, sex:sex, headsize:headsize, height:height, weight:weight, deliveryinfo:deliveryinfo, birthtype:birthtype, birthlocation:birthlocation},
		success: saveComplete
	});
	/*function nextBabyInfo(){
		$.ajax({
			url: '../sanghyo/babyInfo1.action',
			type: 'POST',
			dataType: 'json',
			data: {name:name, borndate:borndate, bornweek:bornweek, sex:sex, headsize:headsize, height:height, weight:weight, deliveryinfo:deliveryinfo, birthtype:birthtype, birthlocation:birthlocation},
			success: saveComplete
			
		});
	}*/
	function saveComplete(){
		alert('완료?');
	}
}

